<%@ page language="java" import="java.util.*,com.knife.member.*" pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
String msg="";
int id=0;
if(request.getParameter("id")!=null){
	id				= Integer.parseInt(request.getParameter("id"));
}
String type 		= request.getParameter("type");

Documenttype adoct = new Documenttype();
DocumenttypeDAO doctDAO = new DocumenttypeDAO();
if(id>0){
	adoct=doctDAO.findById(id);
}
adoct.setType(type);
try{
	doctDAO.save(adoct);
	msg="编辑成功！";
}catch(Exception e){
	msg="编辑失败！";
}
%>
<script language="javascript">
alert("<%=msg%>");
history.back(-1);
</script>